﻿
using System.Security.Cryptography;

namespace GSOrganization.Application;

/// <summary>
/// 采用 MD5 加解密方式。
/// </summary>
public class EncryptAndDecrypte
{
    /// <summary>
    /// 默认加密字符串。 
    /// </summary>
    /// <param name="encryptString"></param>
    /// <returns></returns>
    public static string EncryptString(string encryptString)
    {
        if (string.IsNullOrWhiteSpace(encryptString)) return encryptString;

        var inputBytes = Encoding.UTF8.GetBytes(encryptString);

        var hashBytes = MD5.HashData(inputBytes);

        return Convert.ToHexString(hashBytes);
    }
   
}
